<!--
 * @Author: XJayXu
 * @Date: 2021-05-12 13:42:46
 * @LastEditTime: 2021-05-12 16:42:29
 * @LastEditors: XJayXu
 * @Description: 公用的分页组件二次封装
-->
<template>
  <div class="pagination">
    <el-pagination
      :total="totalSize"
      :current-page="currentPage"
      :page-sizes="pageSizes"
      :page-size="pageSize"
      background
      layout="total, sizes, prev, pager, next, jumper"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  props: {
    currentPage: {
      type: [String, Number],
      default: 1
    },
    pageSize: {
      type: [String, Number],
      default: 10
    },
    totalSize: {
      type: [String, Number],
      default: 0
    },
    pageSizes: {
      type: Array,
      default: () => [5, 10, 20, 30]
    }
  },
  data() {
    return {};
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    handleSizeChange(pagesize) {
      this.$emit("changePageSize", pagesize);
    },
    handleCurrentChange(currentPage) {
      this.$emit("changeCurrentPage", currentPage);
    }
  }
};
</script>

<style scoped lang="scss">
@import "~@/styles/variables.scss";
.pagination {
  position: absolute;
  right: 0;
  bottom: 5px;
  ::v-deep .el-pagination {
    color: #fff;
    button {
      // background-color: #0092b8;
      background-color: transparent;
      border: 1px solid #0092b8;
      border-radius: 4px;
      color: #fff;
    }
    .el-pagination__total,
    .el-pagination__jump {
      color: #fff;
    }
    .el-pager {
      .number,
      .more {
        background-color: transparent;
        border: 1px solid #0092b8;
        border-radius: 4px;
        color: #fff;
        &:hover {
          color: #fff;
          background-color: #0092b8;
        }
      }
      .active {
        background-color: #0092b8 !important;
      }
    }
  }
}
</style>
